class: center, middle, inverse, title-slide # Compare locations/events with geobubble charts --- layout: true <div class="dk-footer"> <span> <a href="https://rfortherestofus.com/" target="_blank">R for the Rest of Us </a> </span> </div> --- class: center, middle, dk-section-title background-image:url("https://images.pexels.com/photos/2853937/pexels-photo-2853937.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260") background-size: cover # Compare locations (or events) with geobubble charts --- # Geobubble charts <center><img src='images/gg_brazil_cities.png' width='800px'/></center> --- # Geobubble charts <center><img src='images/gg_quakes.png' width='700px'/></center> --- # Geobubble <span style='color:#fd8f24'>scales</span>
In a geobubble chart we use the <span style='color:#c03728'>size aesthetic</span> of `geom_point()` to vary the size of our bubbles. -- There are <span style='color:#fd8f24'>**two extremely different scales**</span> that {ggplot2} can use to decide how to vary the sizes of the points: -- - scale_size()<sup>1</sup> - scale_radius() .footnote[ [1] The default chosen by {ggplot2} ] --- ## Don't use scale_radius() <center><img src='images/gg_bubble_size_by_radius.png' width='800px'/><center> --- ## Use scale_size_area() <center><img src='images/gg_bubble_size_by_area.png' width='800px'/><center> --- class: my-turn ## My turn .pull-left[ I'm going to recreate this geobubble chart. ] .pull-right[ <center><img src='images/gg_brazil_cities.png' width='800px'/></center> ] --- #
<span style='color:#919c4c'>geom_point(pch = ?)</span> geom_point() is unique in that it has a `pch`<sup>1</sup> argument - this controls which shape is drawn on your chart. <br> <img src='images/gg_shape_types.png'/> .footnote[ [1] `pch` stands for "plotting character" ] --- class: inverse ## Your turn .pull-left[ Use the `your-turn.R` script in 02_04 to create this geobubble chart of the most popular airports in the US. - Ensure small circles are not overlapped by bigger circles - Give the circles both a fill color and border color ] .pull-right[ <img src='images/gg_us_airports.png'/> ]